<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    
</body>
<script>
    class SH {
        constructor(){
            this.props = window 
            this.modify = {} // 记录修改
            this.active()
        }
        active(){
            this.hot = {} // 拍照
            for (const props in window ) {
                if(window.hasOwnProperty(props)){
                    this.hot[props] =window[props] 
                }
            }
            Object.keys(this.modify).forEach(props => {
                window[props] = this.modify(props)
            })
        }
        inactive() {
            this.hot = {} // 拍照
            for (const props in window ) {
                if(window.hasOwnProperty(props)){
                    if (window[props] !== this.hot[props]) {
                        this.modify[props] = window[props]
                        window[props] = this.hot[props]
                    }                    
                }
            }
        }
    }

    const sh = new SH()
</script>
</html>